package com.zb.service.impl;

import com.zb.dao.TCategoryMapper;
import com.zb.model.TCategory;
import com.zb.model.TGoods;
import com.zb.service.CategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public  class CategoryServiceImpl implements CategoryService{

	@Autowired
	private TCategoryMapper tcm;
	

	public String selectCateIdByNameService(String cateName) {
		return tcm.selectByCateName(cateName);
	}
	
	public List<TCategory> selectCate() {
		return tcm.selectCate();
	}
	
	
	public List<TGoods> selectGoodsByCateIdService(String cateId) {
		return tcm.selectByCateId(cateId);
	}

	public List<TGoods> dimSelectService(String goods_dimSearch) {
		goods_dimSearch="%"+goods_dimSearch+"%";
		return tcm.dimSelect(goods_dimSearch);
	}

	@Override
	public void deleteCate(String cateid) {
		tcm.deleteCate(cateid);
	}

	@Override
	public void addCate(TCategory cate) {
		tcm.addCate(cate);
		
	}

	@Override
	public void reCate(TCategory cate) {
		tcm.reCate(cate);
		
	}
	
}
